/**
 * 
 */
package leetCode;

/**
 * @author zhong
 *
 */
public class PeakIndexinaMountainArray {
	public int peakIndexInMountainArray(int[] A) {
		int max = -1, index = -1;
		for (int i = 0; i < A.length; i++) {
			if (A[i] > max) {
				max = A[i];
				index = i;
			}
		}
		return index;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int[] A = { 0, 2, 1, 0 };
		System.out.println(new PeakIndexinaMountainArray().peakIndexInMountainArray(A));
	}

}
